package com.angel.interfaces;

import com.angel.application.commandgateways.AngelHelpCommandService;
import com.angel.application.commandgateways.commands.PublishAngelHelpCommand;
import com.angel.infrastructure.common.ResultBody;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 * 更新关注微信公众号： 为了offer
 * @author parkin
 * @description
 * @date 2021/11/13
 */
@RestController
@RequestMapping("/angel_mission")
public class AngelHelpController {

    private final AngelHelpCommandService angelHelpCommandService;

    public AngelHelpController(AngelHelpCommandService angelHelpCommandService) {
        this.angelHelpCommandService = angelHelpCommandService;
    }

    @PostMapping("/publish")
    public ResultBody<ResultBody.Empty> publishAngelMission(@RequestBody PublishAngelHelpCommand publishAngelHelpCommand) {
        angelHelpCommandService.publishAngelHelp(publishAngelHelpCommand);
        return ResultBody.SUCCESS;
    }
}
